import pandas as pd
from o_930955_hongLiDiBo100 import O930955, calc

if __name__ == '__main__':
    _2025_4fou = O930955()
    _2024_4fou = O930955()
    _2023_4fou = O930955()
    _2022_4fou = O930955()
    _2021_4fou = O930955()

    # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    _2025_4fou.three_year_ago = '20221101'
    _2024_4fou.three_year_ago = '20211101'
    _2023_4fou.three_year_ago = '20201101'
    _2022_4fou.three_year_ago = '20191101'
    _2021_4fou.three_year_ago = '20181101'

    _2025_4fou.one_year_ago = '20241101'
    _2024_4fou.one_year_ago = '20231101'
    _2023_4fou.one_year_ago = '20221101'
    _2022_4fou.one_year_ago = '20211101'
    _2021_4fou.one_year_ago = '20201101'

    _2025_4fou.zero_year_ago = '20251031'
    _2024_4fou.zero_year_ago = '20241031'
    _2023_4fou.zero_year_ago = '20231031'
    _2022_4fou.zero_year_ago = '20221031'
    _2021_4fou.zero_year_ago = '20211031'

    datetime_202404: tuple = (pd.to_datetime('20241101'), pd.to_datetime('20251031'))
    datetime_202304: tuple = (pd.to_datetime('20231101'), pd.to_datetime('20241031'))
    datetime_202204: tuple = (pd.to_datetime('20221101'), pd.to_datetime('20231031'))
    datetime_202104: tuple = (pd.to_datetime('20211101'), pd.to_datetime('20221031'))
    datetime_202004: tuple = (pd.to_datetime('20201101'), pd.to_datetime('20211031'))
    datetime_201904: tuple = (pd.to_datetime('20191101'), pd.to_datetime('20201031'))
    datetime_201804: tuple = (pd.to_datetime('20181101'), pd.to_datetime('20191031'))

    print(type(pd.to_datetime('20211101')))

    _2025_4fou.intervals = [datetime_202404, datetime_202304, datetime_202204]
    _2024_4fou.intervals = [datetime_202304, datetime_202204, datetime_202104]
    _2023_4fou.intervals = [datetime_202204, datetime_202104, datetime_202004]
    _2022_4fou.intervals = [datetime_202104, datetime_202004, datetime_201904]
    _2021_4fou.intervals = [datetime_202004, datetime_201904, datetime_201804]

    _2025_4fou.zzqz_date = '20251031'
    _2024_4fou.zzqz_date = '20241031'
    _2023_4fou.zzqz_date = '20231031'
    _2022_4fou.zzqz_date = '20221031'
    _2021_4fou.zzqz_date = '20211029'

    # todo
    _2025_4fou.str_930955_date = '20251031'
    _2024_4fou.str_930955_date = '20241231'
    _2023_4fou.str_930955_date = '20231229'
    _2022_4fou.str_930955_date = '20221230'
    _2021_4fou.str_930955_date = '20211231'

    _2025_4fou.str_filePre = 'zfile/a20251105_1/a20251105_930955_4fou_2025'
    _2024_4fou.str_filePre = 'zfile/a20251105_1/a20251105_930955_4fou_2024'
    _2023_4fou.str_filePre = 'zfile/a20251105_1/a20251105_930955_4fou_2023'
    _2022_4fou.str_filePre = 'zfile/a20251105_1/a20251105_930955_4fou_2022'
    _2021_4fou.str_filePre = 'zfile/a20251105_1/a20251105_930955_4fou_2021'

    calc(_2025_4fou)
    calc(_2024_4fou)
    calc(_2023_4fou)
    calc(_2022_4fou)
    calc(_2021_4fou)

    pass
